<template>
  <div class="banner">
    <el-carousel :interval="5000" arrow="always">
      <el-carousel-item v-for="item in banner" :key="item.id">
        <img :src="item.photo" alt />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  name: "Banner",
  data() {
    return {
      banner: [
        {
          id: 1,
          photo: require("../../assets/imgs/banner/1.jpg")
        },
        {
          id: 2,
          photo: require("../../assets/imgs/banner/2.jpeg")
        },
        {
          id: 3,
          photo: require("../../assets/imgs/banner/3.jpg")
        },
        {
          id: 4,
          photo: require("../../assets/imgs/banner/4.jpg")
        }
      ],
    };
  }
};
</script>

<style scoped >
.banner {
  width: 1216px;
  margin: 20px auto;
  border: 1px solid rgb(253, 252, 252);
}
.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>
